<template>
	<view class="lead-page-main-box" @tap="changes">
		<image class="bg-image" mode="widthFix" src="https://h5.sx2b2c.com/images/common/leadPage/bg.png"></image>
		<view class="lead-page-box">
			<image class="lead-icon" mode="heightFix" src="https://h5.sx2b2c.com/images/common/leadPage/lead-icon.png">
			</image>
			<image class="lead-btn" mode="widthFix" src="https://h5.sx2b2c.com/images/common/leadPage/lead-btn.png">
			</image>
		</view>

	</view>
</template>

<script setup>
	import {
		statistics,
		createoder,
		wxLogin,
		send,
		check,
		subOrder,
		getYys,
		youku,
		addLog
	} from '../../api/index.js'
	export default {
		data() {
			return {
				url: "",
				mobile: "",
				a: "",
				pro: "",
				env: "",
				param: "",
				openid: ''

			};
		},
		methods: {
			changes() {



			}
		},

		onLoad(option) {
			if (option.a) {
				this.a = option.a

				if (option.mobile) {
					this.mobile = option.mobile
				}
				if (option.pro) {
					this.pro = option.pro
				}
				if (option.param) {
					this.param = option.param
				}
				if (option.env) {
					this.env = option.env
				}
				if (option.openid) {
					this.openid = option.openid
				}



				let system = navigator.userAgent.toLowerCase();
				//判断打开环境
				if (/MicroMessenger/.test(window.navigator.userAgent)) {

				} else if (/AlipayClient/.test(window.navigator.userAgent)) {

				} else {
					let option = {
						pro: 'alipay_new_sign_yk001', //0.1版本
						openid: this.openid,
						mobile: this.value,
						env: this.env,
						a: this.a,
						param: this.param
					}

					addLog({
						v1: 1,
						v2: 18183352344,
						text: JSON.stringify(option)
					}).then((res) => {
						console.log(res)
					})
					uni.showLoading({
						title: "正在订购",
						mask: true
					})

					youku({
						pro: this.pro,
						openid: this.openid,
						mobile: this.mobile,
						env: this.env,
						a: this.a,
						param: this.param
					}).then((res) => {
						window.location.href = res.data.url

					})
				}


			}
		}
	}
</script>

<style lang="scss" scoped>
	@keyframes butChange {
		0% {
			transform: scale(1);
		}

		50% {
			transform: scale(1.1);
		}

		100% {
			transform: scale(1);
		}
	}

	.lead-page-main-box {
		background-color: #fff;
		position: fixed;
		width: 100vw;
		min-height: 100vh;
		left: 0;
		top: 0;
		z-index: 9;
		display: flex;
		justify-content: center;
		align-items: center;

		.bg-image {
			display: block;
			width: 90%;
			margin-top: -300rpx;
		}

		.lead-page-box {
			position: absolute;
			left: 0;
			top: 0;
			width: 100%;
			min-height: 100vh;
			background: url('https://h5.sx2b2c.com/images/common/leadPage/shadown.png');

			.lead-icon {
				width: auto;
				height: 500rpx;
				display: block;
				position: absolute;
				top: 30rpx;
				right: 30rpx;
			}

			.lead-btn {
				position: absolute;
				width: 80%;
				height: auto;
				display: block;
				left: 10%;
				top: 78vw;
				animation: butChange 2s infinite;

			}

		}
	}
</style>